<!--
 * @Author: 袁十一
 * @Date: 2023-09-24 16:33:45
 * @LastEditTime: 2023-09-24 16:34:20
 * @LastEditors: 袁十一
 * @Description: 
 * @FilePath: \Vue3_admin_template\src\components\SvgIcon\index.vue
 * 初心不变，意志坚定
-->
<template>
  <div>
    <svg :style="{ width: width, height: height }">
      <use :xlink:href="prefix + name" :fill="color"></use>
    </svg>
  </div>
</template>

<script setup lang="ts">
defineProps({
  //xlink:href属性值的前缀
  prefix: {
    type: String,
    default: '#icon-',
  },
  //svg矢量图的名字
  name: String,
  //svg图标的颜色
  color: {
    type: String,
    default: '',
  },
  //svg宽度
  width: {
    type: String,
    default: '16px',
  },
  //svg高度
  height: {
    type: String,
    default: '16px',
  },
})
</script>
<style scoped></style>
